﻿<%@ import namespace='DerptelligenceSite.Areas.Marein.Models.Blog' %>

<%@ Page Title="" Language="C#" MasterPageFile="Blog.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="entries" runat="server">

	<%
		
		IEnumerable<BlogEntry> entries;
		entries = BlogDatabase.GetEntriesByTopic( (String)ViewData["topic"] );
		
		foreach ( BlogEntry entry in entries )
		{

			BlogTopic topic = BlogDatabase.GetTopicByShortTitle( entry.topic );
			
			%>

			<div class="entry">
				
				<div class="entry_title" style=" <%= BlogLayout.TopicColourStyle( background: topic.color_border, text: topic.color_textarea ) %> " >
					
					<h2> <%= entry.title %> </h2>
					
				</div>
					
				<div class="entry_info">
					
					Written on <%= entry.publishdate %> and filed under <%= topic.title %>.
					<br>25 comments. Tags: <%= entry.tags %> ...
					
				</div>
					
				<%= BlogLayout.OpenDoubleDiv( "entry_content",
						BlogLayout.TopicColourStyle( background: topic.color_border ),
						BlogLayout.TopicColourStyle( background: topic.color_textarea, text: topic.color_text ) ) %>
						
						<%= entry.content %>
						
				<%= BlogLayout.CloseDoubleDiv( "entry_content" ) %>
				
			</div>

	<%	} %>

</asp:Content>



<asp:Content ID="Content3" ContentPlaceHolderID="site_title" runat="server">
					
	<% BlogTopic page_topic = BlogDatabase.GetTopicByShortTitle( (String)ViewData["topic"] ); %>

	<h1 style=" <%= BlogLayout.TopicColourStyle( text: page_topic.color_textarea ) %> " >
		
		<%= BlogDatabase.GetStaticContentByName( "site_title" ).content%>

	</h1>

</asp:Content>



<asp:Content ID="Content2" ContentPlaceHolderID="page_columnright" runat="server">
					
	<% BlogTopic page_topic = BlogDatabase.GetTopicByShortTitle( (String)ViewData["topic"] ); %>
	
	<%= BlogLayout.OpenDoubleDiv( "page_topics_top",
			BlogLayout.TopicColourStyle( background: page_topic.color_border ),
			BlogLayout.TopicColourStyle( background: page_topic.color_textarea, text: page_topic.color_text ) )%>
				
		<div class="page_topic_title">

			<%= page_topic.title%>

		</div>

		<hr style=" <%= BlogLayout.TopicColourStyle( border: page_topic.color_border ) %> " />
					
		<div class="page_topic_info">
					
			<%= page_topic.info%>

		</div>

	<%= BlogLayout.CloseDoubleDiv( "page_topics_top" ) %>
				
	<%	IList<BlogTopic> topics = BlogDatabase.GetTopics();
		
		for ( int i = 0; i <= topics.Count-1; i++ )
		{
			BlogTopic topic = topics[i];
			
			if ( topic.title != page_topic.title )
			{

				if ( i != topics.Count - 1 )
				{ %>

					<a href="/marein/blog/<%= topic.title %>">
					
						<%= BlogLayout.OpenDoubleDiv( "page_topics_middle",
							BlogLayout.TopicColourStyle( background: page_topic.color_border ),
							BlogLayout.TopicColourStyle( background: page_topic.color_textarea, text: page_topic.color_text ) ) %>
					
							<%= topic.title %>
						
						<%= BlogLayout.CloseDoubleDiv( "page_topics_middle" ) %>
					
					</a>
				
	<%			}
				else
				{ %>

					<%= BlogLayout.OpenDoubleDiv( "page_topics_bottom",
							BlogLayout.TopicColourStyle( background: page_topic.color_border ),
							BlogLayout.TopicColourStyle( background: page_topic.color_textarea, text: page_topic.color_text ) ) %>
					
						<%= topic.title %>
						
					<%= BlogLayout.CloseDoubleDiv( "page_topics_bottom" )%>

	<%			}
			}
		} %>


	<%= BlogLayout.OpenDoubleDiv( "page_explore",
			BlogLayout.TopicColourStyle( background: page_topic.color_border ),
			BlogLayout.TopicColourStyle( background: page_topic.color_textarea, text: page_topic.color_text ) ) %>
				
		<%= BlogDatabase.GetStaticContentByName( "page_explore" ).content %>
				
	<%= BlogLayout.CloseDoubleDiv( "page_explore" ) %>
	

	<%= BlogLayout.OpenDoubleDiv( "page_footer",
			BlogLayout.TopicColourStyle( background: page_topic.color_border ),
			BlogLayout.TopicColourStyle( background: page_topic.color_textarea, text: page_topic.color_text ) ) %>
				
		<%= BlogDatabase.GetStaticContentByName( "page_footer" ).content %>
				
	<%= BlogLayout.CloseDoubleDiv( "page_footer" ) %>

</asp:Content>





<%--<asp:Content ID="Content2" ContentPlaceHolderID="page_topic_title" runat="server">

	<% String view_topic = (String)ViewData["topic"]; %>
	<%= BlogDatabase.GetTopicByShortTitle( view_topic ).title%>

</asp:Content>



<asp:Content ID="Content7" ContentPlaceHolderID="page_topic_info" runat="server">

	<% String view_topic = (String)ViewData["topic"]; %>
	<%= BlogDatabase.GetTopicByShortTitle( view_topic ).info%>

</asp:Content>



<asp:Content ID="Content4" ContentPlaceHolderID="page_topics" runat="server">

	<%	
		String view_topic = (String)ViewData["topic"];
		BlogTopic page_topic = BlogDatabase.GetTopicByShortTitle( view_topic );

		IList<BlogTopic> topics = BlogDatabase.GetPageTopics();
		
		for ( int i = 0; i <= topics.Count-1; i++ )
		{
			BlogTopic topic = topics[i];
			
			if ( topic.title != page_topic.title )
			{

				if ( i != topics.Count - 1 )
				{ %>

					<a href="/marein/blog/<%= topic.title %>"> <div id ="page_topics_middle"> <%= topic.title %> </div> </a>
				
	<%			}
				else
				{ %>
					<div id ="page_topics_bottom"> <%= topic.title %> </div>
	<%			}
			}
		} %>

</asp:Content>



<asp:Content ID="Content5" ContentPlaceHolderID="page_explore" runat="server">

	<%= BlogDatabase.GetStaticContentByName( "page_explore" ).content%>

</asp:Content>



<asp:Content ID="Content6" ContentPlaceHolderID="page_footer" runat="server">

	<%= BlogDatabase.GetStaticContentByName( "page_footer" ).content%>

</asp:Content>
--%>